package com.msb.mallsearch.controller;

import com.msb.mallsearch.service.MallSearchService;
import com.msb.mallsearch.vo.SearchParam;
import com.msb.mallsearch.vo.SearchResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.Mapping;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;

/**
 * @Auther: xixifeng
 * @Date: 2022/10/30 - 10 - 30 - 14:11
 * @Description: com.msb.mallsearch.controller
 * @version: 1.0
 */

@Controller
public class searchController {


    @Autowired
    MallSearchService mallSearchService;
    //页面传过来的检索信息
    @GetMapping(value = {"/list.html","/"})
    public String listPage(SearchParam param, Model model){

        SearchResult search= mallSearchService.search(param);
        model.addAttribute("result",search);

        return "index";
    }

}
